# 设置构建类型为 Debug，开启调试信息
set(CMAKE_BUILD_TYPE Debug)
add_compile_options(-g)

file(GLOB_RECURSE SRC_FILES
    "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
    "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp"
)

add_executable(defect_dectect_system main.cpp ${SRC_FILES})

target_include_directories(defect_dectect_system PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/include
    ${CMAKE_SOURCE_DIR}/3rdparty/hikvision/include
    ${CMAKE_SOURCE_DIR}/3rdparty/rk_mpi_mmz/include
    ${CMAKE_SOURCE_DIR}/3rdparty/rknpu2/include
    ${CMAKE_SOURCE_DIR}/3rdparty/liballocator/include
    ${CMAKE_SOURCE_DIR}/3rdparty/libdrm/include
    ${CMAKE_SOURCE_DIR}/3rdparty/librga/include

)

target_link_directories(defect_dectect_system PRIVATE
    ${CMAKE_SOURCE_DIR}/3rdparty/hikvision/lib
    ${CMAKE_SOURCE_DIR}/3rdparty/rk_mpi_mmz/lib
    ${CMAKE_SOURCE_DIR}/3rdparty/rknpu2/lib
    ${CMAKE_SOURCE_DIR}/3rdparty/liballocator/lib
    ${CMAKE_SOURCE_DIR}/3rdparty/libdrm/lib
    ${CMAKE_SOURCE_DIR}/3rdparty/librga/lib
)

set(ALLOCATOR_LIB "${CMAKE_SOURCE_DIR}/3rdparty/liballocator/lib/liballocator.so")
set(MPIMMZ_LIB "${CMAKE_SOURCE_DIR}/3rdparty/rk_mpi_mmz/lib/libmpimmz.so")
target_link_libraries(defect_dectect_system PRIVATE
    hcnetsdk
    rga
    drm
    rknnrt
    Qt5::Core
    Qt5::Gui
    Qt5::Widgets
    ${ALLOCATOR_LIB}
    ${MPIMMZ_LIB}
    ${OpenCV_LIBS}
    ${OpenCV_LIBS}
)